package com.caocaog.market.interceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 拦截器配置
 * @author yuki Guo
 * Date 2021/11/14 11:19 上午
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Autowired
    private ApiMemberInterceptor apiLoginInterceptor;


    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        InterceptorRegistration registration = registry.addInterceptor(apiLoginInterceptor);
        registration.addPathPatterns("/api/**");  //拦截用户的
    }


}

